/*
 * @Author: lihaogn
 * @Date: 2021-12-12 14:15:57
 * @LastEditTime: 2022-05-28 10:04:38
 * @LastEditor: lihaogn
 * @Description: user 用户模型种子文件
 *   创建种子文件命令：npx sequelize-cli seed:generate --name seeder-users
 *   运行种子文件命令：npx sequelize-cli db:seed --seed 02-seeder-users
 * @FilePath: \lix-admin-server\database\seeders\02-seeder-users.js
 */
"use strict";
const md5 = require("md5");

module.exports = {
  up: async (queryInterface, Sequelize) => {
    /**
     * Add seed commands here.
     *
     * Example:
     * await queryInterface.bulkInsert('People', [{
     *   name: 'John Doe',
     *   isBetaMember: false
     * }], {});
     */

    return queryInterface.bulkInsert(
      "users",
      [
        {
          id: "000",
          name: "testApi",
          realname: "李昊",
          password: md5("123456"),
          mobile: "",
          email: "",
          status: 1,
          created_at: new Date(),
          updated_at: new Date(),
        },
        {
          id: "001",
          name: "lihaogn",
          realname: "李昊",
          password: md5("123456"),
          mobile: "",
          email: "",
          status: 1,
          created_at: new Date(),
          updated_at: new Date(),
        },
      ],
      {}
    );
  },

  down: async (queryInterface, Sequelize) => {
    /**
     * Add commands to revert seed here.
     *
     * Example:
     * await queryInterface.bulkDelete('People', null, {});
     */

    return queryInterface.bulkDelete("users", null, {});
  },
};
